class SHSettingsTab extends MidGamePanel;

var automated GUISectionBackground i_BGSec;
var automated GUICheckBoxButton checkBoxShowDamage, checkBoxShowSKatanaEffects, checkBoxAllowWP;
var automated GUILabel labelShowDamage, labelShowSKatanaEffects, labelAllowWP;
var() config bool checkBoxShowDamageSavedValue;
var() config bool checkBoxShowSKatanaEffectsSavedValue;

event Closed(GUIComponent Sender, bool bCancelled)
{
	SaveConfig();
    Super.Closed(Sender, bCancelled);
}

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
	Super.InitComponent(MyController, MyOwner);
	checkBoxShowDamage.bChecked=checkBoxShowDamageSavedValue;
	SRPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).showDamage=checkBoxShowDamage.bChecked;
	checkBoxShowSKatanaEffects.bChecked=checkBoxShowSKatanaEffectsSavedValue;
	SRPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).showSKatanaEffects=checkBoxShowSKatanaEffects.bChecked;
}

function InternalOnChange( GUIComponent C )
{
	if ( C == checkBoxShowDamage )
	{
		SRPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).showDamage=checkBoxShowDamage.bChecked;
		checkBoxShowDamageSavedValue=checkBoxShowDamage.bChecked;
	}
	if ( C == checkBoxShowSKatanaEffects )
	{
		SRPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).showSKatanaEffects=checkBoxShowSKatanaEffects.bChecked;
		checkBoxShowSKatanaEffectsSavedValue=checkBoxShowSKatanaEffects.bChecked;
	}
	if ( C == checkBoxAllowWP )
	{
		SRPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).SetAccess(checkBoxAllowWP.bChecked);
	}
}

defaultproperties
{
     Begin Object Class=GUISectionBackground Name=BGSec
         bFillClient=True
         Caption="SimHost Settings"
         WinTop=0.018000
         WinLeft=0.019240
         WinWidth=0.961520
         WinHeight=0.798982
         OnPreDraw=BGSec.InternalPreDraw
     End Object
     i_BGSec=GUISectionBackground'PerksSimHostOrg.SHSettingsTab.BGSec'

     Begin Object Class=GUICheckBoxButton Name=ShowDamageCheck
         Hint="Show damage hud"
         WinTop=0.100000
         WinLeft=0.100000
         WinWidth=0.040000
         TabOrder=1
         OnChange=SHSettingsTab.InternalOnChange
         OnKeyEvent=ShowDamageCheck.InternalOnKeyEvent
     End Object
     checkBoxShowDamage=GUICheckBoxButton'PerksSimHostOrg.SHSettingsTab.ShowDamageCheck'

     Begin Object Class=GUICheckBoxButton Name=ShowSKatanaEffectsCheckBox
         Hint="Show special katana effects"
         WinTop=0.200000
         WinLeft=0.100000
         WinWidth=0.040000
         TabOrder=1
         OnChange=SHSettingsTab.InternalOnChange
         OnKeyEvent=ShowSKatanaEffectsCheckBox.InternalOnKeyEvent
     End Object
     checkBoxShowSKatanaEffects=GUICheckBoxButton'PerksSimHostOrg.SHSettingsTab.ShowSKatanaEffectsCheckBox'

     Begin Object Class=GUICheckBoxButton Name=AllowWPCheckBox
         Hint="Allows weapons to be picked up by other players"
         WinTop=0.300000
         WinLeft=0.100000
         WinWidth=0.040000
         TabOrder=1
         OnChange=SHSettingsTab.InternalOnChange
         OnKeyEvent=AllowWPCheckBox.InternalOnKeyEvent
     End Object
     checkBoxAllowWP=GUICheckBoxButton'PerksSimHostOrg.SHSettingsTab.AllowWPCheckBox'

     Begin Object Class=GUILabel Name=ShowDamageLabel
         Caption="Show Damage"
         VertAlign=TXTA_Center
         StyleName="TextLabel"
         WinTop=0.100000
         WinLeft=0.160000
         WinWidth=0.200000
         WinHeight=0.040000
     End Object
     labelShowDamage=GUILabel'PerksSimHostOrg.SHSettingsTab.ShowDamageLabel'

     Begin Object Class=GUILabel Name=ShowSKatanaEffectsLabel
         Caption="Show S.Katana Effects"
         VertAlign=TXTA_Center
         StyleName="TextLabel"
         WinTop=0.200000
         WinLeft=0.160000
         WinWidth=0.300000
         WinHeight=0.040000
     End Object
     labelShowSKatanaEffects=GUILabel'PerksSimHostOrg.SHSettingsTab.ShowSKatanaEffectsLabel'

     Begin Object Class=GUILabel Name=AllowWPLabel
         Caption="Weapon Pickup Enabled"
         VertAlign=TXTA_Center
         StyleName="TextLabel"
         WinTop=0.300000
         WinLeft=0.160000
         WinWidth=0.300000
         WinHeight=0.040000
     End Object
     labelAllowWP=GUILabel'PerksSimHostOrg.SHSettingsTab.AllowWPLabel'

}
